# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>
# Contributor: Gaetan Bisson <bisson@archlinux.org>
# Contributor: Chris Mosher <cmosher01@gmail.com>

pkgname=xa
pkgver=2.3.14
pkgrel=1
pkgdesc='Cross-assembler for the 6502 microprocessor'
arch=(loong64 x86_64)
url='https://www.floodgap.com/retrotech/xa/'
license=(GPL2)
makedepends=(setconf)
source=("http://www.floodgap.com/retrotech/xa/dists/$pkgname-$pkgver.tar.gz")
b2sums=('3dd4f369d69cd85c7c545e4aba7698deb9402946c755ac2709c43cb4a795d1cde730286a4a0df2615c39367443788cd4314bf526def863fa57bc85d36ca2dc60')

prepare() {
  cd $pkgname-$pkgver
  setconf Makefile CFLAGS="$CFLAGS -fPIC -Wl,-z,relro,-z,now"
  setconf Makefile LDFLAGS="$LDFLAGS -z,relro,-z,now"
}

build() {
  make -C $pkgname-$pkgver
}

package() {
  make -C $pkgname-$pkgver DESTDIR="$pkgdir/usr" install
}
